var { findById } = require('../modules/event');

var getHistory = function(sid, sendMessage) {
	findById(sid, function(err, doc) {
		if (err) {
			return;
		}
		if (doc) {
			sendMessage(sid, doc.events, 'event');
			sendMessage(sid, doc.stats, 'stats');
		}
	})
}

module.exports = getHistory;